package bag1;

public class Computer {
    public void open(){
        System.out.println("开机");
    }
    public void close(){
        System.out.println("关机");
    }
    public void useIUSB(IUSB iusb){
        iusb.openDev();
        if(iusb instanceof Mouse){
         Mouse mouse=(Mouse) iusb;
        mouse.divmouse();
        }
        else if(iusb instanceof keyBoard){
            keyBoard keyboard=(keyBoard) iusb;
            keyboard.divkeyBoard();
        }
        iusb.closeDev();
    }
}
